﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Google.GData.Client;
using Google.Contacts;
using DataType;

namespace UtilitiesTest
{
    namespace TestHelper
    {
        public class EventWrapper : EventArgs
        {
            public bool m_result;
            public AutoResetEvent[] m_handlers;
            Thread m_test_thread;

            public EventWrapper()
            {
                m_result = false;

                m_handlers = new AutoResetEvent[1];
                m_handlers[0] = new AutoResetEvent(false);

                m_test_thread = Thread.CurrentThread;
            }

            public void NotifyThrow(Contact a)
            {
                throw new Exception();
            }

            public void IterationThrow(object sender, FeedWrapper<Contact> a)
            {
                throw new Exception();
            }

            public void ActionOperationThrow(object sender, EventWrapper a)
            {
                throw new Exception();
            }

            public void Finish()
            {
                m_result = true;
                m_handlers[0].Set();
            }

            public void Finish(string param1)
            {
                m_result = true;
                m_handlers[0].Set();
            }
        }
    }
}
